package com.book.item.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.book.item.mapper.CateMapper;
import com.book.item.service.CateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.buchong.pojo.CateGory;

import java.util.List;

@Service
@Transactional
public class ICateService extends ServiceImpl<CateMapper, CateGory> implements CateService {
    @Autowired
    private CateMapper cateMapper;
    @Override
    public CateGory finOne(String name) {
        return cateMapper.selectOne(new QueryWrapper<CateGory>().eq("name",name));
    }
    @Override
    public List<CateGory> finByFirst(Integer id){
        return cateMapper.selectList(new QueryWrapper<CateGory>().eq("upperID",id));
    }

}
